﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using VTemplate.Engine;
using VTemplate;
using FL.Bussiness;
using FL.Bussiness.Sys;
using FL.SiteEntity;
using FL.Bussiness.Site;
using System.Text;

namespace FL.Web.BackEnd.Controllers
{
    public class ArticleController : BasePageController
    {
        // GET: Article
        public ActionResult Index(string code="news",int pageindex=0)
        {
            ViewBag.pageindex = pageindex;
            ViewBag.code = code;
            return View();
        }

        /// <summary>
        /// 列表视图
        /// </summary>
        /// <returns></returns>
        public ActionResult ListView()
        {
            return View();
        }

        /// <summary>
        /// 内容视图
        /// </summary>
        /// <param name="id">对应ID</param>
        /// <returns></returns>
        public  ActionResult ArticleView(Guid id)
        {
            ViewBag.id = id;
            
            BArticle BA = new BArticle();
            t_site_article article = BA.GetArticle(ViewBag.id);
            
            ViewBag.article = article;
            //关联信息
            ViewBag.union_articles = BA.GetUnionArticles(article.tags,10,"add_time",1);
            BA.InsertArticleView(id);
            return View();
        }
    }
}